package com.zhenhe.core.common.entity;

import java.util.Date;

import javax.validation.constraints.Past;

import org.apache.ibatis.type.Alias;
import org.hibernate.validator.constraints.Length;

import com.zhenhe.core.common.entity.DataEntity;
import com.zhenhe.core.common.enums.annotation.EnumOnly;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

@Alias("UserEntity")
public class UserEntity extends DataEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = -1266288869648392001L;
	
	@Length(min=6,max=20, message="{module.user.username.error}")
	private String username;
	
	@Length(min=6,max=20, message="{module.user.username.error}")
	private String userAccount;
	
	@JsonIgnore
//	@Length(min=6, max=20, message="{module.user.password.length.error}")
	private String password;

	@Past
	@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
	private Date birthday;
	
	@EnumOnly(enumName="Gender")
	private Integer gender;
	
	private Integer picture;
	
	private Integer userRole;
	
	private String cellphone;
	
	public String getCellphone() {
		return cellphone;
	}

	public void setCellphone(String cellphone) {
		this.cellphone = cellphone;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
	
	public String getUserAccount() {
		return userAccount;
	}

	public void setUserAccount(String userAccount) {
		this.userAccount = userAccount;
	}
	
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getGender() {
		return gender;
	}

	public void setGender(Integer gender) {
		this.gender = gender;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Integer getPicture() {
		return picture;
	}

	public void setPicture(Integer picture) {
		this.picture = picture;
	}

	public Integer getUserRole() {
		return userRole;
	}

	public void setUserRole(Integer userRole) {
		this.userRole = userRole;
	}
	
	
}